#!bin/bash
echo -e "\033[31m --------------卸载服务:卸载之前请确保已备份数据----------------------\033[0m"
echo -e "\033[37m=======================请选择你要卸载的服务======================—————\033[31m"
echo -e "\033[37m 1卸载所有已安装的服务=====================================—————\033[31m"
echo -e "\033[37m 2卸载docker服务===========================================—————\033[31m"
echo -e "\033[37m 3卸载mariadb数据库服务====================================—————\033[31m"
echo -e "\033[37m 4卸载HTTP服务=============================================—————\033[31m"
echo -e "\033[37m 5卸载phpMyadmin服务=======================================—————\033[31m"
echo -e "\033[37m 6卸载vsftpd服务===========================================—————\033[31m"
echo -e "\033[37m 7卸载LAMP环境=============================================—————\033[31m"

read unstall
if [ $unstall == 1 ]
then
	echo -e "\033[37m 正在关闭所有服务,当你选择此项时，在卸载过程中有错误提示属于正常现象======—————\033[31m"
	sh configure/unstall/unstall-docker.sh
	sh configure/unstall/unstall-FTP.sh
	sh configure/unstall/unstall-httpd.sh
	sh configure/unstall/unstall-mariadb.sh
	sh configure/unstall/unstall-phpmyadmin.sh
	sh configure/unstall/unstall-lmp.sh
	echo -e "\033[37m 程序文件删除完成\033[31m"
 #########---------------------------分割线->>卸载所有项结束-----------------####
elif [ $unstall == 2 ]
then
	sh configure/unstall/unstall-docker.sh
	#########---------------------------分割线-----------------------------###
elif [ $unstall == 3 ]
then
	sh configure/unstall/unstall-mariadb.sh
#########---------------------------分割线-----------------------------###
elif [ $unstall == 4 ]
then
	sh configure/unstall/unstall-httpd.sh
#########---------------------------分割线-----------------------------###
elif [ $unstall == 5 ]
then
	sh configure/unstall/unstall-phpmyadmin.sh
#########---------------------------分割线-----------------------------###

#########---------------------------卸载VSFTP-----------------------------###
elif [ $unstall == 6 ]
then
	sh configure/unstall/unstall-FTP.sh
elif [ $unstall == 7 ]
then
	sh configure/unstall/unstall-httpd.sh
	sh configure/unstall/unstall-mariadb.sh
	sh configure/unstall/unstall-phpmyadmin.sh
	sh configure/unstall/unstall-lmp.sh
else
	echo 卸载提示：选择错误
fi
#########---------------------------分割线-----------------------------###
###上面是卸载菜单结束####
echo 是否返回主菜单？y/n
read main
if [ $main == y ];then
	sh configure/main.sh
else
echo 感谢使用
	rm -rf configure
fi

